package com.ailk.cuc.autotestbg.common.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.logging.Log;

public class DateUtils {

	private static Log logger = LogUtils.getLogger(DateUtils.class.getName());
	public static String getNowDate() {
		Calendar nowDate = Calendar.getInstance();
		Date coverDate = nowDate.getTime();
		String dateFormat = new String("yyyyMMddHHmmss");
		SimpleDateFormat sDF = new SimpleDateFormat(dateFormat);
		String tempDate = sDF.format(coverDate);
		logger.debug("nowDate : "+tempDate);
		return tempDate;
	}

	public static String getNow2YMDHH() {
		Calendar nowDate = Calendar.getInstance();
		Date coverDate = nowDate.getTime();
		String dateFormat = new String("yyMMddHH");
		SimpleDateFormat sDF = new SimpleDateFormat(dateFormat);
		String tempDate = sDF.format(coverDate);
		logger.debug("now2YMDHH : "+tempDate);
		return tempDate;
	}

	public static String getNowDateSSS() {
		Calendar nowDate = Calendar.getInstance();
		Date coverDate = nowDate.getTime();
		String dateFormat = new String("yyyyMMddHHmmssSSS");
		SimpleDateFormat sDF = new SimpleDateFormat(dateFormat);
		String tempDate = sDF.format(coverDate);
		logger.debug("nowDateSSS : "+tempDate);
		return tempDate;
	}
}
